<?php
$this->pageTitle = Yii::app()->name . ' - Contact Us';
?>
<div class="left">
    <div class="wrap-page">
	<div class="title-page"><strong>Contact Us</strong></div>
	<?php if (Yii::app()->user->hasFlash('contact')): ?>
    	<div class="flash-success">
		<?php echo Yii::app()->user->getFlash('contact'); ?>
    	</div>
	<?php else: ?>
    	<div class="alert alert-info">
		<?php echo settings()->get('text_site', 'text_contact') ?>
    	</div>

    	<div class="contact-form">

		<?php
		$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
		    'type' => 'horizontal',
		    'clientOptions' => array(
			'validateOnSubmit' => true,
		    ),
		    'enableClientValidation' => true
		));
		?>

    	    <div class="control-group">    		
    		<div class="info-contact">Fields with <span class="required">*</span> are required.</div>    
    	    </div>

		<?php echo $form->errorSummary($model); ?>

		<?php echo $form->textFieldRow($model, 'name', array('size' => 60, 'maxlength' => 128, 'class' => 'span5')); ?>
		<?php echo $form->textFieldRow($model, 'email', array('size' => 60, 'maxlength' => 128, 'class' => 'span5')); ?>
		<?php echo $form->textFieldRow($model, 'phone', array('size' => 60, 'maxlength' => 128, 'class' => 'span5')); ?>

		<?php echo $form->textFieldRow($model, 'subject', array('size' => 60, 'maxlength' => 128, 'class' => 'span5')); ?>


		<?php echo $form->textAreaRow($model, 'body', array('rows' => 6, 'cols' => 50, 'class' => 'span5', 'style' => 'width:370px')); ?>


		<?php if (extension_loaded('gd')): ?>
		    <div class="control-group">
			<label class="control-label">Verify Code</label>
			<div class="controls">
			    <?php $this->widget('CCaptcha'); ?>
			    <br/>
			    <div class="info-contact">
				<?php echo $form->textField($model, 'verifyCode'); ?>
				<p class="help-block">Please enter the letters as they are shown in the image above.
				    <br/>Letters are not case-sensitive.</p>
			    </div>

			</div>
		    </div>
		<?php endif; ?>

    	    <div class="form-actions">
    		<input type="submit" value="Submit" class="btn btn-primary" name="send-message"/>
		    <?php /*
		      <input type="reset" value="Reset" class="btn btn-danger" />
		     * 
		     */ ?>
    	    </div>

		<?php $this->endWidget(); ?>

    	</div><!-- form -->

	<?php endif; ?>
    </div>
</div>
<div class="right">  
    <div class="box-right">
	<?php $this->widget('application.widgets.loginbox.LoginBox'); ?>

    </div><!--box-right-->
    <?php $this->widget('application.widgets.ad.Ad'); ?>
</div><!--right-->